// server.js（完整版）
const express = require("express");
const app = express();
const readline = require("readline");
const fs = require("fs");

app.get("/auth/get/user/info/1.0", (req, res) => {
  res.json({
    code: 0,
    data: {
      sub: "1968911108064415744",
      aud: "uc",
      ver: "v2",
      nickname: "User3430",
      iss: "auth-center",
      language: "zh_CN",
      avatar: "default.png",
      iat: "1758781793",
      exp: "1758785393",
      agent_user_id: "1968911108081192960",
      overseas_use: null,
      platform_type: "miniapp",
      " agent_code": "contract",
      data_encrypted: "",
    },
    message: "ok",
    description: "",
    total: 0,
    maxPage: 0,
  });
  // res.json({
  //   "code": 14000000,
  //   "data": null,
  //   "message": "未找到认证Token",
  //   "description": "",
  //   "total": 0,
  //   "maxPage": 0
  // });
});

app.post('/file/uploa/1.0', (req, res) => {
  setTimeout(() => {
    res.json({
      code: 0,
      data: JSON.stringify({ contract_id: '1972955157984350208', contract_type: '买卖合同', lang: 'zh' }),
      // data: JSON.stringify({ contract_id: '1963570115085062144', contract_type: '买卖合同' }),
      message: '文件上传成功'
    });
  }, 1000);
})

app.get('/auth/get/token/1.0', (req, res) => {
  res.redirect('http://172.20.14.113:5173/');
});


app.listen(3001);
